﻿using System.Windows.Navigation;
using Microsoft.Phone.Controls;

namespace TourGuideApp
{
	public partial class TourDetailsPage : PhoneApplicationPage
	{
		public int tourIndex{get;private set;}
		
		public TourDetailsPage()
		{
			tourIndex = 0;
			InitializeComponent();
		}

		// When page is navigated to set data context to selected item in list
		protected override void OnNavigatedTo(NavigationEventArgs e)
		{
				var tours = (Expression.Blend.SampleData.TourSampleDataSource.toursList)App.Current.Resources["TourSampleDataSource"];
				DataContext = tours.tourCollection[App.tourIndex];
		}
	}
}
